export default {
  state: {
    show: false,
    userInfo: {
      show: false
    },
    switchLession: false,
    addShow: false,
    reUseShow: false,
    tutorModifyTime: false,
    databaseTest: false,
    answerDis: false,
    qrcode: false,
    knowledge: false,
    addBook: false,
    teacherAddLession: false,
    addNode: false,
    alert: false,
    localTest: false
  },
  mutations: {
    switchUserInfo (state, val) {
      state.show = val
      state.userInfo.show = val
    },
    addLession (state, val) {
      state.show = val
      state.addShow = val
    },
    reUseShow (state, val) {
      state.show = val
      state.reUseShow = val
    },
    tutorModifyTime (state, val) {
      state.show = val
      state.tutorModifyTime = val
    },
    showAnswerDis (state, val) {
      state.show = val
      state.answerDis = val
    },
    showQRCode (state, val) {
      state.show = val
      state.qrcode = val
    },
    show (state, key) {
      state[key] = true
      state.show = true
    },
    hide (state, key) {
      state[key] = false
      state.show = false
    },
    display (state, payload) {
      state.show = state[payload.key] = payload.value
    }
  }
}
